import 'package:elephant_fish/http/request/base_request.dart';
import 'package:elephant_fish/http/request/room_request.dart';
import 'package:shared_preferences/shared_preferences.dart';

import 'login_dao.dart';

class RoomDao{
  static room(int classify_id,int type,{String order}){
    if(order != null){
      return getRoom(classify_id,type,order: order);
    }
    return getRoom(classify_id,type);
  }

  static getRoom(int classify_id, int type,{String order}) async {
    SharedPreferences prefs = await SharedPreferences.getInstance();
    String appToken = prefs.getString('app-token');
    BaseRequest request = RoomRequest();
    var result = await request.add('classify_id', classify_id).add('type', type).add('order', order).addHeader('usertoken', appToken);
    return result;
  }
}